<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Super Administrator</title>
<link rel="stylesheet" type="text/css" href="http://<%=request.getServerName()%>/OnlineExam/jsp/style.css" media="screen" />
</head>
<body>

<jsp:include page="common/header.jsp"/>

<b><center>Super Administrator Control Panel: </center></b> <br /><br />

<%@page language="java" import="OnlineExam.validate.*, OnlineExam.*, OnlineExam.administrator.*, java.util.*"%>
<%
	
	List<Category> list = Category.selectAllCategories();
	
%>

<b><center>Categories </center></b>
<table border = "1" align ="center">
<thead><tr>
<th>CategoryId</th><th>CategoryName</th><th>CategoryAdmin</th><th>TestLength</th><th>TimeLimit</th><th>QuestionGeneration</th>
</tr></thead>
<%
	for (ListIterator iter = list.listIterator(); iter.hasNext();)
	{
		Category category = (Category) iter.next();
%>
     <tr><td> <%= category.getCategoryId()%></td>
     <td> <%= category.getCategoryName() %></td>
     <td> <%= category.getCategoryAdmin() %></td>
	 <td> <%= category.getTestLength() %></td>
	 <td> <%= category.getTimeLimit() %></td>
	 <td> <%= category.getQuestionGeneration() %></td>
	 <td><form><input type="button" value="delete" onClick="window.open('http://<%= request.getServerName() %>/OnlineExam/administrator/DeleteCategory.jsp?categoryId=<%=category.getCategoryId()%>','mywindow2','width=500,height=200')"></form></td></tr>
<%
  	}
%>
</table> <br /><br />
<center><table><tr>
<form action="AddCategory.jsp" method="get">
   <td><input type="Submit" value="AddCategory"></td>
</form>
<form action="ViewCategories.jsp" method="get">
<td><input type="Submit" value="Refresh"></td>
</form>
</tr></table></center>

<jsp:include page="common/footer.jsp"/>

</body>
<hr /><br />
</html>
